﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Jayden.Dll.BitTorrent
{
	public class BitTorrentBlock
	{
		public const int DefaultBlockLength = 16 * 1024;

		private BitTorrentPiece m_Piece;
		private int m_Offset;
		private int m_Length;
		private byte[] m_Data;

		public BitTorrentBlock(BitTorrentPiece piece, int offset, int length = DefaultBlockLength)
		{
			m_Piece = piece;
			m_Offset = offset;
			m_Length = Math.Min(piece.PieceLength - offset, length);
		}
	}
}
